package com.example.a2209_shop.adapter

import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.a2209_shop.R
import com.example.base.entity.GoodsEntity

/**
 * 商品列表适配器
 */
class GoodsAdapter:BaseQuickAdapter<GoodsEntity,BaseViewHolder>(R.layout.item_goods) {
    override fun convert(holder: BaseViewHolder, item: GoodsEntity) {
        Glide.with(context).load(item.goods_default_icon).into(holder.getView(R.id.goods_icon))
        holder.setText(R.id.goods_desc,item.goods_desc)
        holder.setText(R.id.goods_price,"￥${item.goods_default_price}.00起")
    }
}